package
{
	import flash.display.Sprite;

	import Tool.ToolBar;

	import org.aswing.AsWingManager;
	import org.aswing.BoxLayout;
	import org.aswing.Container;
	import org.aswing.FlowLayout;
	import org.aswing.JButton;
	import org.aswing.JFrame;
	import org.aswing.JOptionPane;
	import org.aswing.JWindow;
	import org.aswing.border.LineBorder;
	import org.aswing.event.AWEvent;

	[SWF(width="1000", height="800", frameRate="30", backgroundColor="0xfff123")]
	/**
	 *
	 * @author Inch
	 */
	public class MyAsWing extends Sprite
	{
		private var myButton:JButton;
		private var myFrame:JFrame;
		private var frame:JFrame;
		private var window:JWindow;
		private var pane:Container;

		/**
		 *
		 */
		public function MyAsWing()
		{
			Init();
			//初始化
			AsWingManager.initAsStandard(this);


			var _button:JButton=new JButton("弹出框");
			_button.addActionListener(click);

			var windows:JWindow=new JWindow();

			
			windows.show();
			/**创建按钮*/
			myButton=new JButton("Click Me");
			myButton.addActionListener(__buttonClicked);



			/**创建一个窗体*/
			myFrame=new JFrame(this, "My Frame");
			myFrame.getContentPane().setLayout(new FlowLayout());
			myFrame.getContentPane().append(myButton);


			myFrame.setSizeWH(300, 200);
			myFrame.x=500;


		}

		private function click(e:AWEvent):void
		{
			myFrame.show();
		}

		private function __buttonClicked(e:AWEvent):void
		{
			JOptionPane.showMessageDialog("Hello", "Hello, World!", null, null, true, null, 5);
		}


		private function Init():void
		{
			var _ToolBar:ToolBar=new ToolBar();
			addChild(_ToolBar);
		}
	}
}
